home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 6 / FM Towns Free Software Collection 6.iso / ms_dos / mos / source / mos106.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-08  |  607 b   |  25 lines

  1.  
  2. /*
  3.  *
  4.  *    MOS106 : ボタンの押下情報の読み取り
  5.  *
  6.  */
  7.  
  8. #include <stdio.h>
  9. #include <dos.h>
  10.  
  11. unsigned int MOS_on_status(unsigned char no,unsigned char *status,unsigned char *count,signed int *horizon,signed int *vertical) {
  12.    union  REGS  inregs, outregs;
  13.    struct SREGS segregs;
  14.  
  15.    segread(&segregs);
  16.    inregs.h.ah=0x05;
  17.    inregs.h.al=no;
  18.    int86x(0x99,&inregs,&outregs,&segregs);
  19.    *status=(unsigned char)outregs.h.ch;
  20.    *count=(unsigned char)outregs.h.cl;
  21.    *horizon=(signed int)outregs.x.dx;
  22.    *vertical=(signed int)outregs.x.bx;
  23.    return (unsigned int)outregs.h.ah;
  24. }
  25.